<script type="text/javascript">
function pic_upload_success(file, data) {
                var json = $.parseJSON(data)
                $(this).bjuiajax('ajaxDone', json)
                if (json[BJUI.keys.statusCode] == BJUI.statusCode.ok) {
                        $('#slide_pic_up').hide();
                        $('#j_slide_pic').val(json.filename).trigger('validate')
                        $('#j_slide_span_pic').html('<img src="' + json.filename + '" width="100" />')
                }
        }
</script>
<div class="bjui-pageContent" >
        <div data-layout-h="0">
                <!-- 内容区 -->
                <form action="{:U('System/slide_add')}" class="pageForm nice-validator n-red" data-loadingmask='false' data-toggle="validate" novalidate="novalidate" data-reload-navtab="true" method="post" >
                        <input type="hidden" name="id" value="{$_GET.id|default=''}" />
                        <table class="table table-condensed table-hover">
                                <tr>
                                        <td width='150'><label style='margin-left:40px;'>图片：</label></td>
                                        <td>
                                                <div style="display:inline-block; vertical-align:middle;">
                                                        <div id="slide_pic_up" data-toggle="upload" data-uploader="{:U('Pub/image_upload?path=slide')}" 
                                                             data-file-size-limit="1024000000"
                                                             data-file-type-exts="*.jpg;*.png;*.gif;*.mpg"
                                                             data-multi="false"
                                                             data-on-upload-success="pic_upload_success"
                                                             data-icon="cloud-upload"
                                                             data-preview-img ='false'
                                                             data-auto='true'></div>
                                                        <input type="text" data-rule='required' name="image" value="{$slide.image|default=''}" id="j_slide_pic">
                                                        <br/>
                                                        <span id="j_slide_span_pic">
                                                                {notempty name='slide.image'}
                                                                <img src="{$slide.image|default=''}"  width='100'/>
                                                                {/notempty}
                                                        </span>
                                                </div>
                                        </td>
                                </tr>

                                <tr>
                                        <td width='150'><label style='margin-left:40px;'>类别：</label></td>
                                        <td>
                                                <select data-toggle="selectpicker" data-rule='required' name="type" >
                                                        <option value="">选择分类</option>
                                                        <option value="1"{eq name="slide.type" value="1"} selected{/eq}>展示于PC站</option>
                                                        <option value="2"{eq name="slide.type" value="2"} selected{/eq}>展示于Mobile站</option>
                                                </select>   
                                        </td>

                                </tr>
                                <tr>
                                        <th ><label style='margin-left:40px;'>图片链接：</label></th>
                                        <td>
                                                <input type="text" name="url" data-rule="required" value="{$slide.url|default=''}" placeholder="/" />
                                                <div class="alert alert-warning form-inline"><i class="fa fa-warning"></i> 链接格式：/hainan </div>
                                        </td>

                                </tr>
                                <tr>
                                        <th ><label style='margin-left:40px;'>图片说明：</label></th>
                                        <td>
                                                <input type="text" name="desc" data-rule="required" value="{$slide.desc|default=''}" />
                                        </td>

                                </tr>
                                <tr>
                                        <th ><label style='margin-left:40px;'>图片排序：</label></th>
                                        <td>
                                                <input type="text" name="sort" size="10"  value="{$slide.sort|default=''}" />
                                        </td>

                                </tr>
                        </table>
                </form>
        </div>

</div>
<div class="bjui-pageFooter" border='none'>
        <ul>
                <li><button type="button" class="btn btn-close">关闭</button></li>
                <li><button type="submit" class="btn btn-default">提交</button></li>
        </ul>
</div>